package f.h.dragon.reflection.invoker;

import java.lang.reflect.InvocationTargetException;

/**
 * Invoker: the invoker of method/field
 * 
 * @author Wenlong Meng(wenlong.meng@gmail.com)
 * @version 1.0 at 2012/04/24
 * @since 1.0
 */
public interface Invoker {

	//Logic
	/**
	 * invoke: see {@link java.lang.reflect.Method#invoke(Object, Object...)}
	 * 
	 * @param target
	 *            the object the underlying method is invoked from
	 * @param args
	 *            the arguments used for the method call
	 * @return the result of dispatching the method represented by this object
	 *         on <code>target</code> with parameters <code>args</code>
	 * @throws IllegalAccessException
	 * @throws InvocationTargetException
	 */
	Object invoke(Object target, Object[] args) throws IllegalAccessException,
			InvocationTargetException;

	/**
	 * the type of method
	 * 
	 * @return
	 */
	Class<?> getType();

}
